MMM 数据库的高可用架构
========================================
http://windchasereric.blog.51cto.com/5419433/1785287
http://lanxianting.blog.51cto.com/7394580/1783917
一：介绍
1.1： 准备
    官网：http://mysql-mmm.org
    下载地址：http://mysql-mmm.org/downloads

1.2：介绍
    mysql-mmm-agent 
    mysql-mmm-monitor   
    mysql-mmm-tools 

/usr/lib/perl5/vendor_perl/5.8.8/MMM    MMM使用的perl模块
/usr/lib/mysql-mmm        MMM的脚本插件
/usr/sbin   MMM的命令保存路径
/var/log/mysql-mmm   MMM的日志保存路径
/etc   MMM配置文件保存的路径
/etc/mysql-mmm   MMM配置文件保存的路径，优先级最高
/etc/init.d/  agentd和monitor的启动关闭脚本

1.3：安装依赖
    ~]# yum -y install gcc gcc-c++ ncurses-devel cpan perl-devel


二：安装

2.1：安装
    ~]# make install




log-error=/usr/local/mysql/log/error.log
long_query_time=5
slow_query_log=/usr/local/mysql/log/slow.log

log-bin=mysql-bin
binlog_format=ROW

server-id       = 1
#log-bin   =  /var/log/mysql/mysql-bin.log
#log-bin-index   =  /var/log/mysql/mysql-bin.index
relay-log   =  /var/log/mysql/mysql-relay-bin
relay-log-index   =  /var/log/mysql/mysql-relay-bin.index
expire_logs_days = 10
max_binlog_size = 100M
log_slave_updates  =1

auto_increment_increment=2
auto_increment_offset=1
bind-address = 0.0.0.0







mkdir -p  /usr/share/perl5/vendor_perl/MMM /usr/lib/mysql-mmm /usr/sbin /var/log/mysql-mmm /etc /etc/mysql-mmm /etc/init.d/
cp -r lib/Common/ /usr/share/perl5/vendor_perl/MMM
[ -f /etc/mysql-mmm/mmm_common.conf ] || cp etc/mysql-mmm/mmm_common.conf /etc/mysql-mmm/
mkdir -p /usr/lib/mysql-mmm/agent/
cp -r lib/Agent/ /usr/share/perl5/vendor_perl/MMM
cp -r bin/agent/* /usr/lib/mysql-mmm/agent/
cp -r etc/init.d/mysql-mmm-agent /etc/init.d/
cp sbin/mmm_agentd /usr/sbin
[ -f /etc/mysql-mmm/mmm_agent.conf  ] || cp etc/mysql-mmm/mmm_agent.conf  /etc/mysql-mmm/
mkdir -p /usr/lib/mysql-mmm/monitor/
cp -r lib/Monitor/ /usr/share/perl5/vendor_perl/MMM
cp -r bin/monitor/* /usr/lib/mysql-mmm/monitor/
cp -r etc/init.d/mysql-mmm-monitor /etc/init.d/
cp sbin/mmm_control sbin/mmm_mond /usr/sbin
[ -f /etc/mysql-mmm/mmm_mon.conf    ] || cp etc/mysql-mmm/mmm_mon.conf    /etc/mysql-mmm/
mkdir -p /usr/lib/mysql-mmm/tools/
cp -r lib/Tools/ /usr/share/perl5/vendor_perl/MMM
cp -r bin/tools/* /usr/lib/mysql-mmm/tools/
cp sbin/mmm_backup sbin/mmm_clone sbin/mmm_restore /usr/sbin
[ -f /etc/mysql-mmm/mmm_tools.conf  ] || cp etc/mysql-mmm/mmm_tools.conf  /etc/mysql-mmm/








